<!-- 更多信息 -->

<template>
  <div>
    <EasyRow col3>
      <FormTree
        :label="`${CORE.MAP.ASSET}分类`"
        bind="assetTypeId, assetTypeName"
        :dict="$root.device_category_treeDict"
        required
      />
      <FormTree
        :label="`所属${CORE.MAP.ORGAN}`"
        bind="organizationId, organizationName"
        :dict="CORE.ORGAN.DICT"
        onlyAdd
        required
      />
      <FormInput :label="`所在${CORE.MAP.REGION}`" bind="auto" disabled />
    </EasyRow>

    <EasyRow col3>
      <FormSelect label="供应商" bind="supplierId, supplierName, concatPhone" :dict="supplier_selectDict" />
      <FormSelect :label="`所属${CORE.MAP.CONTRACT}`" bind="projectId, projectName" :dict="contract_selectDict" />
      <FormNum label="单价 (元)" bind="price" :min="0" :max="99999999.99" dec2 />
    </EasyRow>

    <EasyRow col3>
      <FormDate label="购置日期" bind="purchaseDate" history string />
      <FormDate label="启用日期" bind="useTime" required />
      <FormNum :label="`${CORE.MAP.ASSET}年限`" bind="fixedNumberOfYear" :min="0" tip="请输入" string />
    </EasyRow>

    <EasyRow col3>
      <FormSelect label="开启折旧" bind="depreciationEnable" :dict="CORE.DICT.YES" noClear @change="changeEnable" />
      <FormSelect
        label="折旧方法"
        bind="depreciationType"
        :dict="DICT.OLD_TYPE"
        :disabled="one.depreciationEnable !== 1"
        required
      />
      <FormNum
        label="净残率"
        bind="depreciationRemain"
        suffix="%"
        :min="0"
        :max="100"
        :init="INIT_ONE.depreciationRemain"
        dec2
        :disabled="one.depreciationEnable !== 1"
        required
      />
    </EasyRow>

    <FormSelectMulti label="设备标签" bind="tagIdList" :dict="tagDict" triple @change="changeTag" />

    <FormTextarea label="备注信息" bind="description" :rows="2" :max="50" />

    <FormFile
      label="技术文档"
      bind="assetFileList"
      folder="device"
      :max="0"
      :limit="10"
      :newObj="{ assetId: one.id }"
    />
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import AddMore from '@admin/views/Maintain/Device/DeviceList/MyModal/FormAdd/AddMore'

// ============================== 导出组件 ============================== //

export default CORE.extend(AddMore, {
  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [
    CORE.mixWeb('iot'),
    CORE.mixSelect('supplier', 'supplier_'),
    CORE.mixSelect('contract', 'contract_'),
  ],
})
</script>
